<?php

    require_once("model/route.class.php");
    require_once("model/place.class.php");
    
    class predefRoutes{
      
        static public function size() { return 5; }
        
        /**
         * Henter ut all informasjon fra en fjellovergang utfra en id.
         * 1 - Dovrefjell
         * 2 - Filefjell
         * 3 - Hardangervidda
         * 4 - Hol - Aurland
         * 5 - Haukelifjell
         * 
        */
        static public function getRoute($id){
            //	$collectionTab = array();
            switch($id){
                case 1:	//Dovrefjell..
                $dovrefjell = new RouteModel("E", "6", "Dovrefjell","http://www.vegvesen.no/trafikk/xml/search.xml?searchFocus.counties=5&searchFocus.counties=16&searchFocus.messageType=17&searchFocus.messageType=38&searchFocus.messageType=21&searchFocus.messageType=18&searchFocus.messageType=22&searchFocus.messageType=20&searchFocus.messageType=23&searchFocus.messageType=19&searchFocus.roadNumber=6&searchFocus.roadTypes=Ev&searchFocus.roadTypes=Rv&searchFocus.sortOrder=3");
                $dovrefjell->setStartPlace(new PlaceModel(
                                  "Dombås",
                                  "http://www.yr.no/sted/Norge/Oppland/Dovre/Dombås/varsel.xml"
                    ));
                
                $dovrefjell->setMiddlePlace(new PlaceModel(
                                  "Hjerkinn",
                                  "http://www.yr.no/sted/Norge/Oppland/Dovre/Hjerkinn/varsel.xml"
                    ));
                
                $dovrefjell->setEndPlace(new PlaceModel(
                                  "Oppdal",
                                  "http://www.yr.no/sted/Norge/Sør-Trøndelag/Oppdal/Oppdal/varsel.xml"
                    ));
                return $dovrefjell;
                break;
                
                case 2:	//Filefjell..
                $filefjell = new RouteModel("E", "16", "Filefjell","http://www.vegvesen.no/trafikk/xml/search.xml?searchFocus.counties=6&searchFocus.counties=14&searchFocus.messageType=17&searchFocus.messageType=38&searchFocus.messageType=21&searchFocus.messageType=18&searchFocus.messageType=22&searchFocus.messageType=20&searchFocus.messageType=23&searchFocus.messageType=19&searchFocus.roadNumber=16&searchFocus.roadTypes=Ev&searchFocus.roadTypes=Rv&searchFocus.sortOrder=3");
                $filefjell->setStartPlace(new PlaceModel(
                                  "Tyinkrysset",
                                  "http://www.yr.no/sted/Norge/Oppland/Vang/Tyinkrysset/varsel.xml"
                    ));
                
                $filefjell->setMiddlePlace(new PlaceModel(
                                  "Vardin",
                                  "http://www.yr.no/sted/Norge/Oppland/Vang/Vardin/varsel.xml"
                    ));
                
                $filefjell->setEndPlace(new PlaceModel(
                                  "Maristova",
                                  "http://www.yr.no/sted/Norge/Sogn_og_Fjordane/Lærdal/Maristova/varsel.xml"
                    ));
                return $filefjell;
                break;
                
                case 3:	// Hardangervidda..
                $route = new RouteModel("Rv", "7", "Hardangervidda","http://www.vegvesen.no/trafikk/xml/search.xml?searchFocus.counties=6&searchFocus.counties=12&searchFocus.messageType=17&searchFocus.messageType=38&searchFocus.messageType=21&searchFocus.messageType=18&searchFocus.messageType=22&searchFocus.messageType=20&searchFocus.messageType=23&searchFocus.messageType=19&searchFocus.roadNumber=7&searchFocus.roadTypes=Ev&searchFocus.roadTypes=Rv&searchFocus.sortOrder=3");
                $route->setStartPlace(new PlaceModel(
                                  "Dyranut",
                                  "http://www.yr.no/sted/Norge/Hordaland/Eidfjord/Dyranut_Turisthytta/varsel.xml"
                    ));
                
                $route->setMiddlePlace(new PlaceModel(
                                  "Halne",
                                  "http://www.yr.no/sted/Norge/Hordaland/Eidfjord/Halne/varsel.xml"
                    ));
                
                $route->setEndPlace(new PlaceModel(
                                  "Haugastøl",
                                  "http://www.yr.no/sted/Norge/Buskerud/Hol/Haugastøl/varsel.xml"
                    ));
                return $route;
                break;
                
                case 4:	// Aurland - Hol
                $route = new RouteModel("Rv", "50", "Hol - Aurland","http://www.vegvesen.no/trafikk/xml/search.xml?searchFocus.counties=6&searchFocus.counties=14&searchFocus.messageType=17&searchFocus.messageType=38&searchFocus.messageType=21&searchFocus.messageType=18&searchFocus.messageType=22&searchFocus.messageType=20&searchFocus.messageType=23&searchFocus.messageType=19&searchFocus.roadNumber=50&searchFocus.roadTypes=Ev&searchFocus.roadTypes=Rv&searchFocus.sortOrder=3");
                $route->setStartPlace(new PlaceModel(
                                  "Hol",
                                  "http://www.yr.no/sted/Norge/Buskerud/Hol/Hol/varsel.xml"
                    ));
                
                $route->setMiddlePlace(new PlaceModel(
                                  "Geiterygghytta",
                                  "http://www.yr.no/sted/Norge/Buskerud/Hol/Geiterygghytta/varsel.xml"
                    ));
                
                $route->setEndPlace(new PlaceModel(
                                  "Aurlandsvangen",
                                  "http://www.yr.no/sted/Norge/Sogn_og_Fjordane/Aurland/Aurlandsvangen/varsel.xml"
                    ));
                return $route;
                break;
                
                case 5:	// Haukelifjell
                $route = new RouteModel("E", "134", "Haukelifjell","http://www.vegvesen.no/trafikk/xml/search.xml?searchFocus.counties=12&searchFocus.counties=8&searchFocus.messageType=17&searchFocus.messageType=38&searchFocus.messageType=21&searchFocus.messageType=18&searchFocus.messageType=22&searchFocus.messageType=20&searchFocus.messageType=23&searchFocus.messageType=19&searchFocus.roadNumber=134&searchFocus.roadTypes=Ev&searchFocus.roadTypes=Rv&searchFocus.sortOrder=3");
                $route->setStartPlace(new PlaceModel(
                                  "Åmot",
                                  "http://www.yr.no/sted/Norge/Telemark/Vinje/Åmot/varsel.xml"
                    ));
                
                $route->setMiddlePlace(new PlaceModel(
                                  "Haukeligrend",
                                  "http://www.yr.no/sted/Norge/Telemark/Vinje/Haukeligrend/varsel.xml"
                    ));
                
                $route->setEndPlace(new PlaceModel(
                                  "Røldal",
                                  "http://www.yr.no/sted/Norge/Hordaland/Odda/Røldal/varsel.xml"
                    ));
                return $route;
                break;

                default:
                die("feil i getRoute(), storage/predefRoutes.php");
            }
        }
    }
?>